Array.prototype.count = function() {
    return this.length;
};
function loading_start(){
	$("#load_status").html("<img src='images/loading.gif' /> loading...").fadeIn()
}
function loading_end(){
	$("#load_status").fadeOut().html("")
}

function resize_content_div(){
	/*
	 * Fix del problema che si verifica se il div#content non riempie la pagina correttamente
	 */

	final_height = $(window).height()-180
	content_height = $("content").height()
	window_height= $("window").height()
	if (!jQuery.browser.msie) {
		return false
	}
/*
	if (content_height < final_height) {
		$("#content").animate({
			height: final_height+"px",
		}, 500)
	}
*/
}

function get_JSON(url){
	JSON_data = $.ajax({
		url: url,
		async: false
	}).responseText
	JSON_data = JSON.parse(JSON_data)
	return JSON_data
}

function hide_error_message(){
	$("#load_status").hide("slow")
}

function display_error_message(msg){
	$("#load_status").html(msg).show("slow")
	setTimeout("hide_error_message()",3000)
}

function user_edit(JSONdata){
	$("#content").html("loading...")
	res = $.ajax({
		url: "pages/form_user.php",
		async: false
	}).responseText
	$("#content").html(res)
}
